<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Quote Demo (English)</title>
	<link href="../../../common/common.css" type="text/css" rel="stylesheet"/>
	<link href="../../../ui/dragdrop/dragdrop.css" type="text/css" rel="stylesheet"/>
	<link href="../../../ui/datagrid/datagrid.css" type="text/css" rel="stylesheet"/>
	<link href="../../../ui/scrollpanel/scrollpanel.css" type="text/css" rel="stylesheet"/>
	<link href="../../../ui/selectbutton/selectbutton.css" type="text/css" rel="stylesheet"/>
	<link href="../../../widgets/autocomplete/autocomplete.css" type="text/css" rel="stylesheet"/>
	<link href="../../../widgets/quote/quote.css" type="text/css" rel="stylesheet"/>
	<link href="../../../theme/default/style.css" type="text/css" rel="stylesheet"/>

	<script type="text/javascript" src="../../../lib/jquery.js"></script>
	<script type="text/javascript" src="../../../lib/jquery.mousewheel.js"></script>
	<script type="text/javascript" src="../../../lib/jquery.json.min.js"></script>
	<script type="text/javascript" src="../../../core/common.js"></script>
	<script type="text/javascript" src="../../../core/permissionChecker.js"></script>
	<script type="text/javascript" src="../../../core/tickers.js"></script>
	<script type="text/javascript" src="../../../core/subscriber.js"></script>
	<script type="text/javascript" src="../../../core/dataHandler.js"></script>
	<script type="text/javascript" src="../../../core/pull.js"></script>
	<script type="text/javascript" src="../../../core/push.js"></script>
	<script type="text/javascript" src="../../../core/SDKDataManager.js"></script>


	<script src="../../../formatter/qs_formatter_en_us.js" type="text/javascript"></script>
	<script src="../../../language/en_us/qs_quote_en_us.js" type="text/javascript"></script>

	<script type="text/javascript" src="../../../common/common.js"></script>
	<script type="text/javascript" src="../../../ui/util/util.js"></script>
	<script type="text/javascript" src="../../../ui/dragdrop/dragdrop.js"></script>
	<script type="text/javascript" src="../../../ui/scrollpanel/scrollpanel.js"></script>
	<script type="text/javascript" src="../../../ui/datagrid/datagrid.js"></script>
	<script type="text/javascript" src="../../../ui/selectbutton/selectbutton.js"></script>

	<script type="text/javascript" src="../../../widgets/quote/quotebase.js"></script>
	<script type="text/javascript" src="../../../widgets/quote/quote.js"></script>
	<script type="text/javascript" src="../../../widgets/quote/quote_settingpanel.js"></script>
	<script type="text/javascript" src="../../../widgets/autocomplete/autocomplete.js"></script>
	<script type="text/javascript" src="../../../widgets/quote/quote_datapoints_map.js"></script>
	<script type="text/javascript" src="../../../theme/default/style.js"></script>
<script>
$(document).ready(function(){
	QSAPI.init('DISN');
	QSAPI.Authentication.login("511F1BFFABACF2797D53014B7B7EF29F502E7015781E8D93A04989A70197E422B9AC0FE2E59882CDC9713E118EEA680F7F0E859C73FBD6BEF64C7DD04490EF1A","62D2A0641B01FBF65FA127365CDC0DC427458A67D958FC979718FF067CCD1A8D8D4E839255D60957C1A502D25C724A1D65F6EEE07636A0AA84E8F51C8D1831EE",{
		onSuccess:function(result){
			QSAPI.DataManager.connectToPull("http://qsstage.morningstar.com/pullservice/pull/getPullQuote.jsp",5000,{
                 onSuccess:function(eventType){
					$("#status").text("Successfully")
					Quote();
				},
                onFailure:function(eventType,err){							
					$("#status").text("Fail")
                }				
    		});	
		}
	});
});

function Quote() {
	QSAPI.TickerFactory.create(["MSFT"], {
		onSuccess : function(tickerList) {
			var option = {
				quoteToolBar:{
					position:'top',						//Quote will show on the top, option value includes "top/bottom" , default is "top"
					queryBox:{							//Quote query box options 
						show:true,						//Display query box, default is true
						buttonText:'Go'					//Text on the query button, default is "Go"
					},
					setting:{							//Quote datapoints setting options
						show:true,						//Display setting button, default is true
						buttonText:'Setting',			//Text on the setting button
						width : 150,					//Setting panel width, default is 150
						height : 200					//Setting panel height, default is 200
					}
				},
				dataPoints:['BidPrice',
				            'BidSize',
				            'AskPrice',
				            'AskSize',
				            'HighPrice',
				            'LowPrice',
				            'Volume',
				            'ClosePrice',
				            'OpenPrice',
				            'st168',
				            'st169',
				            'st109',
				            'st106',
				            'sta65',
				            'pm032',
				            'st159',
				            'sta0f',
				            'st160',
				            'st198',
				            'st408',
				            'st415',
				            'st410',
				            'st263',
				            'sta44',
				            'pd003',
				            'pd005',
				            'pd007',
				            'pd009',
				            'pm493',
				            'pd00d',
				            'pd014',
				            'pd00f',
				            'pd00h',
				            'pm494',
				            'pm495',
				            'pd00b',
				            'VWAP',
				            'LastMarket',
				            'st200',
				            'os378',
				            'st476',
				            'os089',
				            'OpenInt',
				            'expirydate',
				            'strikeprice'
				            ],
				hasUnqiue:true,
				showHead:true,
				width:900,
				height:300,
				fixHeight:true
			};

			var callbacks={
				onLoad : function(data) {
					//console.log("load");
				},
				onHeightChange : function(data) {
					//console.log("height change");
				},
				onClick : function() {
					//console.log("click");
				},
				onStateChange : function(state) {
					//console.log(state ? state + " Change"	: "default state change");
				},
				beforeClear : function() {
					//console.log("before clear");
				},
				afterAcceptTicker:function(){
					//console.log("after acctep ticker");
				},
				beforeClear:function(){
					//console.log("before clear");
				},
				afterAddDatapoints:function(){
					//console.log("afterAddDatapoint");
				},
				afterRemoveDatapoints:function(){
					//console.log("afterRemoveDatapoint");
				}
			};
			var container1=document.getElementById("container1");
			var id0 = 'quote_'+Util.IdProducer.getId();
			var tickerObject0 = tickerList[0];
			var quote0 = new QSAPI.Widget.Quote(container1, option,callbacks, id0);
			quote0.init();
			quote0.acceptTicker(tickerObject0);

		}
	})
}
</script>
</head>
<body>
	<div><span>Push Connection:</span><span id="status"></span></div>
	<br>
	<div id="container1"></div>
	<br>
	<br>
	<div id="container2"></div>
</body>
</html>